//renders a selectable cube as part of the 3d interface

var doll = (function (_doll) {
    _doll.ui = _doll.ui || {};
    _doll.ui.CUBE = 0;
    _doll.ui.SPHERE = 1;

    _doll.ui.selectable = function(position, shape, size) {
        console.log("creating selectable...");
        if(shape === undefined) {
            shape = _doll.ui.CUBE;
        }
        
        if(size === undefined) {
            size = 50;
        }
        
        if(shape == _doll.ui.CUBE) {
            this.geometry = new THREE.CubeGeometry(size,size,size);
        }
        else {
            this.geometry = new THREE.SphereGeometry(size);
        }
        
        this.material = new THREE.MeshLambertMaterial( {
            color: 0x5CCBFA, ambient: 0x5CCBFA, shading: THREE.FlatShading
        });

        this.mesh = new THREE.Mesh(this.geometry, this.material);
        this.mesh.position.copy(position);
        
        _doll.ui.add(this);
        return this.mesh;
    };
    return _doll;
}(doll || {}));
